// Given two strings s and t, write a function to determine if t is an anagram of s.
// 
// For example,
// s = "anagram", t = "nagaram", return true.
// s = "rat", t = "car", return false.
// 
// Note:
// You may assume the string contains only lowercase alphabets.、、

class Solution {
public:
    bool isAnagram(string s, string t) 
	{
    	int nlenght = s.size();
		if(nlenght != t.size())
		{
			return false;
		}
		
		int arr[26] = {0};
		
		for(int i = 0 ; i<nlenght ; i++)
		{
			arr[s[i]-97] = arr[s[i]-97]+1; 
			arr[t[i]-97] = arr[t[i]-97]-1; 			
		}			    
		  
		for(int j = 0 ; j<26 ; j++)
		{
			if(arr[j] != 0)
			{
				return false;
			}
		}
		
		return true;

    }
};
